#ifndef _APPGLOBAL_DATA_H_
#define _APPGLOBAL_DATA_H_
#include "define.h"

extern UINT32 ThroPWMIn;
extern UINT16 ThroPWMMin;
extern UINT16 ThroPWMMax;
extern UINT16  TM1_usCount;
extern UINT16 TM1_msCount;
extern INT_FLAG TM2_INT_FLAG;
extern code UINT16 MUSIC_FREQ_LIST[8];

extern uint16_t  PWM;







extern volatile uint8_t Phase;		






extern uint16_t MinRpmPulse;		
extern bit gNotFullThro;
extern char CompBlankCNT;
#define COMM_TIME_MAX 0x400

extern unsigned char code cBEMF_FILTER[];
// general purpose variables
extern unsigned int adc_result;
// commutation parameters
extern signed char comm_state;
extern unsigned int comm_time;
extern bit comm_done,comm_dir;
extern unsigned int pwm_demand;
extern unsigned char bemf_filter;
// COMMUTATION variables
extern unsigned int comm_time,comm_time_max,comm_timer;
extern signed int phase_delay_counter;
extern unsigned int phase_delay;
extern unsigned int phase_delay_filter;
extern bit zc_detected;
extern bit rotor_locked;
extern bit synchronous;
extern bit CommutateDone;
void InitGlobalData();

#endif